/*
 *  benchmark.h
 *  benchmark-perf
 *
 *  Created by Charles on 10-6-21.
 *  Copyright 2010 __MyCompanyName__. All rights reserved.
 *
 */

#include <assert.h>     
#include <stdlib.h>             
#include <stdio.h>              
#include <string.h>             
#include <pthread.h>        
#include <getopt.h>
#include <syslog.h>
#include <sys/resource.h>
#include <time.h>
#include <sys/wait.h>
#include <errno.h>
#include <unistd.h>

#ifndef BENCHMARK
#define BENCHMARK
#define BM_GROUP_THREADS 10
int loglevel = LOG_NOTICE;
char logname[128];

typedef	struct bench
{       
	void* func;//业务函数
	void* param;//业务参数
	long n;//每个线程要执行的次数
	long count;//并发计数器
	long num;//并发的线程总数
	pthread_cond_t cond;
	pthread_mutex_t mutex;
}bench_t;

bench_t bp;

typedef	struct _bm_opts {
	int t;
	int v;
}_bm_opts_t;

//命令行参数
_bm_opts_t bm_opts = {0};

void benchmark(void* param);

#endif
